package com.example.routeplansystem.service;

import java.io.IOException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Service;

import com.example.routeplansystem.entity.dto.ResponseEntity;
import com.example.routeplansystem.entity.po.UserMessage;
import com.example.routeplansystem.entity.vo.UserInfo;

@Service
public interface UserService {
    /**
     * 用户登录：
     */
    ResponseEntity<UserMessage> userLogin(UserInfo userInfo, HttpServletRequest request, HttpServletResponse response);

    /**
     * 生成登陆验证码
     */
    void generateVerifyCode(HttpServletRequest request, HttpServletResponse response) throws IOException;

    /**
     * 用户注册：
     */
    ResponseEntity<UserMessage> userRegister(UserInfo userInfo,HttpServletRequest request, HttpSession session);

    /**
     * 用户邮箱验证码发送
     */
    ResponseEntity<String> sendVerifyMail(String eMailNumber, HttpServletRequest request, HttpServletResponse response);

    /**
     * 退出登录
     */
    ResponseEntity<String> loginOut(HttpServletRequest request);

    /**
     * 自动登录
     */
    boolean autoLogin(HttpServletRequest request) ;

    //根据 role 查询用户
    ResponseEntity<List<UserMessage>> selectUsersByRole(int role);

    ResponseEntity manageUser(UserMessage userMessage, Integer operationType);
}
